package com.aliothservice.catfish.product.data;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import org.springframework.data.annotation.Id;

public class Driver {
	
	public Map<String, String> toMap() {
		Map<String, String> map = new HashMap<String, String>();
		
		map.put("id", this.getId());
		map.put("name", this.getName());
		map.put("phoneNumber", this.getPhoneNumber());
		map.put("gender", this.getGender());
		map.put("drivingAge", this.getDrivingAge().toString());
		DateFormat fullFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
		map.put("lastUpdateTime", fullFormatter.format(this.getLastUpdateTime()));
		if (null != this.getDrivingLicensePhotoId()) {
			map.put("drivingLicensePhotoId", this.getDrivingLicensePhotoId());
		}
		
		return map;
	}
	
	@Id
	private String id;
	
	// who adds this driver
	private String userId;
	
	private String name;
	private String phoneNumber;
	private String gender;
	private Integer drivingAge;
	
	private String drivingLicensePhotoId;
	
	private Date lastUpdateTime;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public Integer getDrivingAge() {
		return drivingAge;
	}

	public void setDrivingAge(Integer drivingAge) {
		this.drivingAge = drivingAge;
	}

	public String getDrivingLicensePhotoId() {
		return drivingLicensePhotoId;
	}

	public void setDrivingLicensePhotoId(String drivingLicensePhotoId) {
		this.drivingLicensePhotoId = drivingLicensePhotoId;
	}

	public Date getLastUpdateTime() {
		return lastUpdateTime;
	}

	public void setLastUpdateTime(Date lastUpdateTime) {
		this.lastUpdateTime = lastUpdateTime;
	}

}
